package com.trace.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author:wesley
 */
@RestController
@EnableEurekaClient
@SpringBootApplication
public class Trace2Application {

    private Logger logger = LoggerFactory.getLogger(Trace2Application.class);


    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }


    @GetMapping(value = "/trace-2")
    public String trace(){
        logger.info("=================================");
        logger.info("==========< trace-2 >============");
        logger.info("=================================");
        return "trace";
    }

    public static void main(String[] args){
        SpringApplication.run(Trace2Application.class,args);
    }


}
